import { toStringTypeCheck } from '../../Func/uniFunc/Func';

const win_loadTag = 'win_load';

const win_load_prop_space_Arr = 'space_arr';

class win_load {
  get [Symbol.toStringTag]() {
    return win_loadTag;
  }

  [win_load_prop_space_Arr] = [];

  constructor() {}

  /**
   * 删除 已有的 管辖域
   * @param {string} spacename
   */
  destroy(spacename) {
    if (toStringTypeCheck(spacename, 'string')) {
      spacename = [spacename];
    }

    for (const key of spacename) {
      if (this.space_arr.includes(key)) {
        this[key].destroy();
      }
    }
  }
}

export { win_load, win_load_prop_space_Arr };
